home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / veryea2a / mdimain.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-10-09  |  2.1 KB  |  83 lines

  1. VERSION 5.00
  2. Begin VB.MDIForm mdimain 
  3.    AutoShowChildren=   0   'False
  4.    BackColor       =   &H8000000C&
  5.    Caption         =   "Easy Writer"
  6.    ClientHeight    =   9180
  7.    ClientLeft      =   165
  8.    ClientTop       =   735
  9.    ClientWidth     =   12330
  10.    LinkTopic       =   "MDIForm1"
  11.    StartUpPosition =   3  'Windows-Standard
  12.    Begin VB.Menu mnuFile 
  13.       Caption         =   "&File"
  14.       Begin VB.Menu mnuNew 
  15.          Caption         =   "New Window"
  16.          Shortcut        =   ^N
  17.       End
  18.       Begin VB.Menu mnuClose 
  19.          Caption         =   "Close all Windows"
  20.       End
  21.       Begin VB.Menu mnuExit 
  22.          Caption         =   "Exit"
  23.          Shortcut        =   ^E
  24.       End
  25.    End
  26.    Begin VB.Menu mnuWindows 
  27.       Caption         =   "&Windows"
  28.       WindowList      =   -1  'True
  29.       Begin VB.Menu mnuStyle1 
  30.          Caption         =   "Style 1"
  31.       End
  32.       Begin VB.Menu mnuStyle2 
  33.          Caption         =   "Style 2"
  34.       End
  35.    End
  36. Attribute VB_Name = "mdimain"
  37. Attribute VB_GlobalNameSpace = False
  38. Attribute VB_Creatable = False
  39. Attribute VB_PredeclaredId = True
  40. Attribute VB_Exposed = False
  41. Option Explicit
  42. Public formcounter As Long
  43. Private Sub MDIForm_Load()
  44. formcounter = 0
  45. End Sub
  46. Private Sub mnuClose_Click()
  47. Dim F As Form
  48.     For Each F In Forms
  49.         If TypeOf F Is frmWriter Then
  50.             Unload F
  51.         End If
  52.     Next
  53. End Sub
  54. Private Sub mnuExit_Click()
  55. Dim Answer
  56. Dim cancel
  57.     Answer = MsgBox(Prompt:="Do you really want to quit?", _
  58.      Title:="Question", _
  59.      Buttons:=vbYesNo + vbQuestion)
  60.     If Answer = vbYes Then
  61.      End
  62.     Else
  63.      cancel = True
  64.     End If
  65. End Sub
  66. Private Sub mnuNew_Click()
  67. Dim F As frmWriter
  68. Dim filename
  69. If formcounter > 0 Then
  70. Set F = New frmWriter
  71. Set F = frmWriter
  72. End If
  73. F.Show
  74. F.Caption = filename
  75. formcounter = formcounter + 1
  76. End Sub
  77. Private Sub mnuStyle1_Click()
  78. mdimain.Arrange vbTileVertical
  79. End Sub
  80. Private Sub mnuStyle2_Click()
  81. mdimain.Arrange vbCascade
  82. End Sub
  83.